package cn.leetcode;

public class Code101 {

    public boolean isSymmetric(TreeNode root) {
        return fun(root.left, root.right);
    }


    public boolean fun(TreeNode left, TreeNode right){
        if(left == null && right == null)
            return true;
        if(left == null)
            return false;
        if(right == null)
            return false;
        if(left.val != right.val)
            return false;
        boolean fun1 = fun(left.left, right.right);
        boolean fun2 = fun(left.right, right.left);
        return fun1 && fun2;
    }


}
